var e = require;
var t = module;
var n = exports;
("use strict");
Object.defineProperty(n, "__esModule", { value: !0 }), (n.Platform = void 0);
var o = e("XMADMediatorUtils"),
  i = e("BasePlatform"),
  r = e("PlatformConst"),
  y = e("BmsManager"),
  e =
    ((a.prototype.setPlatform = function () {}),
    (a.prototype.setConfig = function () {
      this.config = new r.PlatformConfig[r.EPlatform.KS]();
      console.error('setconfig config: ', this.config);
    }),
    (a.prototype.setNoAd = function (e) {
      this.isNoAD = e;
    }),
    (a.prototype.judgePlatform = function () {
      var e = cc.sys,
        t = e.platform;
      return window.tt
        ? (this.id = r.EPlatform.TT)
        : window.ks
        ? (this.id = r.EPlatform.KS)
        : window.qq
        ? (this.id = r.EPlatform.QQ)
        : window.wx
        ? (this.id = r.EPlatform.WX)
        : t == e.VIVO_GAME
        ? (this.id = r.EPlatform.VIVO)
        : t == e.OPPO_GAME
        ? (this.id = r.EPlatform.OPPO)
        : t == e.IPHONE || t == e.IPAD
        ? (this.id = r.EPlatform.IOS)
        : t == e.ANDROID && this.id == r.EPlatform.WEB
        ? (this.id = r.EPlatform.ANDROID)
        : (t != e.ANDROID && this.id == r.EPlatform.OPPO_ANDROID) ||
          (t != e.ANDROID && this.id == r.EPlatform.VIVO_ANDROID) ||
          (t != e.ANDROID && this.id == r.EPlatform.XIAOMI_ANDROID) ||
          (t != e.ANDROID && this.id == r.EPlatform.OHAYOO_ANDROID)
        ? (this.id = r.EPlatform.WEB)
        : void 0;
    }),
    (a.prototype.init = function () {
      this.id != r.EPlatform.WEB &&
        ((this.config = new r.PlatformConfig[this.id]()),
        (this.instance = new this.config.platformClass()),
        this.instance.setConfig(this.config));
    }),
    (a.prototype.getPlatform = function () {
      return this.instance;
    }),
    (a.prototype.getConfig = function () {
      return this.config;
    }),
    (a.prototype.is = function (e) {
      return this.id == e;
    }),
    (a.prototype.showRewardAds = function (e) {
      if (this.isNoAD) return e(0);
      this.id == r.EPlatform.XIAOMI_ANDROID
        ? o.XMADMediator.showRewardVideo(e)
        : this.instance.showRewardAds(e);
    }),
    (a.prototype.showRewardAds_xiaomi = function (e) {
      if (this.isNoAD) return e(0);
      this.instance.showRewardAds(e);
    }),
    (a.prototype.showBanner = function (e, t) {
      var n = y.BMS.getKey("bannerAdIntervals");
      if (
        (console.log(
          "== banner检测 cd间隔不展示，cd计时: " +
            this.bannerAdCounter +
            "，cd间隔" +
            n
        ),
        this.bannerAdCounter < n)
      )
        return console.log("== banner cd中，无法触发");
      this.instance.showBanner(e, t);
    }),
    (a.prototype.hideBanner = function (e) {
      this.instance.hideBanner(e), (this.bannerAdCounter = 0);
    }),
    (a.prototype.showNativeAds = function (e, t) {
      this.instance.showNativeAds(e, t);
    }),
    (a.prototype.hideNativeAds = function () {
      this.instance.hideNativeAds();
    }),
    (a.prototype.showInsert = function () {
      this.instance.showInsert();
    }),
    (a.prototype.showBlockAds = function (e) {
      this.instance.showBlockAds(
        (e = void 0 === e ? { id: "", left: null, top: null } : e)
      );
    }),
    (a.prototype.hideBlockAds = function () {
      this.instance.hideBlockAds();
    }),
    (a.prototype.showAppBoxAds = function () {
      this.instance.showAppBoxAds();
    }),
    (a.prototype.hideAppBoxAds = function () {
      this.instance.hideAppBoxAds();
    }),
    (a.prototype.changeBlockAdsPos = function (e) {
      this.instance.changeBlockAdsPos(e);
    }),
    (a.prototype.showNativeAdvanceBigBanner = function (e, t) {
      this.instance.showNativeAdvanceBigBanner(e, (t = void 0 === t ? !1 : t));
    }),
    (a.prototype.hideNativeAdvanceBigBanner = function () {
      this.instance.hideNativeAdvanceBigBanner();
    }),
    (a.prototype.showInsertBannerImg = function (e, t) {
      this.instance.showInsertBannerImg(e, (t = void 0 === t ? !1 : t));
    }),
    (a.prototype.hideInsertBannerImg = function () {
      this.instance.hideInsertBannerImg();
    }),
    (a.prototype.share = function (e) {
      this.instance.share(e);
    }),
    (a.prototype.shareRecordCap = function (e) {
      this.instance.shareRecordCap(e);
    }),
    (a.prototype.startRecordCap = function (e) {
      this.instance.startRecordCap(e);
    }),
    (a.prototype.stopRecordCap = function () {
      this.instance.stopRecordCap();
    }),
    (a.prototype.getShareStatus = function () {
      return this.instance.getShareStatus();
    }),
    (a.prototype.showPrivacyPolicy = function () {
      return this.instance.showPrivacyPolicy();
    }),
    (a.prototype.report = function (e, t) {
      this.instance.report(e, t);
    }),
    (a.prototype.showMoreGame = function () {
      this.instance.showMoreGame();
    }),
    (a.prototype.showLargeFeed = function (e, t) {
      this.instance.showLargeFeed(e, (t = void 0 === t ? 0 : t));
    }),
    (a.prototype.removeLargePicFeed = function (e) {
      this.instance.removeLargePicFeed(e);
    }),
    (a.prototype.showInterstitialFeed = function (e, t, n, o) {
      this.instance.showInterstitialFeed(
        (e = void 0 === e ? "" : e),
        (t = void 0 === t ? 3 : t),
        (n = void 0 === n ? 0 : n),
        (o = void 0 === o ? 0 : o)
      );
    }),
    (a.prototype.showBannerFeed = function (e) {
      this.instance.showBannerFeed(e);
    }),
    (a.prototype.removeBannerFeed = function () {
      this.instance.removeBannerFeed();
    }),
    (a.prototype.gameComment = function () {
      this.instance.gameComment();
    }),
    a);
function a() {
  var e = this;
  (this.id = r.EPlatform.WEB),
    (this.config = new r.PlatformConfig[r.EPlatform.WEB]()),
    (this.instance = new i.BasePlatform()),
    (this.isNoAD = !1),
    (this.bannerAdCounter = 1e10),
    this.setPlatform(),
    this.setConfig(),
    this.judgePlatform(),
    this.init(),
    setInterval(function () {
      e.bannerAdCounter++;
    }, 1e3);
}
n.Platform = new e();
